package com.aqielife.demo.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.aqielife.demo.MQConstant.QUEUE_TOPIC_MUSIC;
import static com.aqielife.demo.MQConstant.QUEUE_TOPIC_SPORT;

/**
 * @author aqie
 * @date 2022/02/06 17:47
 * @desc
 */
@Slf4j
@Component
public class TopicReceiveListener {

  @RabbitListener(queues = QUEUE_TOPIC_MUSIC)
  public void receiveMsg1(String msg) {
    log.info("消费者1接收到 #：" + msg);
  }

  @RabbitListener(queues = QUEUE_TOPIC_SPORT)
  public void receiveMsg2(String msg) {
    log.info("消费者2接收到 *：" + msg);
  }
}
